/**
 * 关键CSS - 首屏渲染必需样式
 * 这些样式会被内联到HTML中，确保首屏快速渲染
 */

/* 基础重置和布局 */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  /* 确保用户可以选择文本 */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

#app {
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

/* 首页关键布局 */
.home-page {
  width: 100%;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  background-color: #f5f5f5;
}

/* 顶部区域 - 关键首屏内容 */
.top-section {
  padding: 16px 0;
  margin-bottom: 16px;
}

/* 欢迎横幅 - 首屏关键元素 */
.welcome-banner {
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  height: 100%;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.banner-description {
  font-size: 1rem; /* 增大字体 */
  line-height: 1.4;
  margin: 0 0 8px 0;
  color: #666;
}

.banner-disclaimer {
  margin-top: 8px;
}

.disclaimer-title {
  font-size: 0.9rem; /* 增大字体 */
  margin-bottom: 6px;
  display: block;
  color: #333;
  font-weight: 600;
}

.disclaimer-text {
  font-size: 0.8rem; /* 增大字体 */
  line-height: 1.3;
  color: #888;
}

/* 公告区域 - 首屏可见 */
.announcements-section {
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  height: 100%;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.announcement-item {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.announcement-item:last-child {
  border-bottom: none;
}

.announcement-title {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  display: block;
  color: #333;
}

.announcement-brief {
  line-height: 1.4;
  display: block;
  color: #666;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.announcement-date {
  white-space: nowrap;
  color: #888;
}

/* 第二行区域 - 数据概览 */
.second-section {
  padding: 16px 0;
  margin-bottom: 16px;
}

.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

/* 卡片基础样式 */
.map-passwords-card,
.stats-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: 100%;
  min-height: auto;
  display: flex;
  flex-direction: column;
}

/* 地图密码网格 */
.map-password-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  flex: 1;
}

/* 地图密码卡片 */
.map-password-naive-card {
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-password-naive-card:hover {
  background: #f0f0f0;
  border-color: #d0d0d0;
  transform: translateY(-1px);
}

.map-card-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.map-icon-container {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.map-icon-0 { background-color: #e3f2fd; color: #1976d2; }
.map-icon-1 { background-color: #f3e5f5; color: #7b1fa2; }
.map-icon-2 { background-color: #fff3e0; color: #f57c00; }
.map-icon-3 { background-color: #e8f5e8; color: #388e3c; }
.map-icon-4 { background-color: #e8eaff; color: #3f51b5; } /* 潮汐监狱 */

.map-info {
  flex: 1;
  min-width: 0;
}

.map-name {
  font-size: 12px; /* 增大字体 */
  font-weight: 500;
  color: #666;
  margin-bottom: 2px;
}

.map-password-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-password-value {
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

/* 统计数据样式 */
.stats-overview {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.stats-naive-card {
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
}

.stats-card-content {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.horizontal-layout {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.stats-card-title {
  color: #666;
  font-weight: 500;
}

.stats-value {
  font-weight: 600;
}

/* 紧凑卡片样式 */
.compact-card {
  min-height: auto !important;
}

.compact-card .n-card__content {
  padding: 6px 8px !important;
}

/* 加载状态 */
.loading-state {
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #666;
}

/* 响应式设计 - 移动设备 */
@media (max-width: 768px) {
  .top-section,
  .second-section {
    padding: 12px 0;
    margin-bottom: 12px;
  }
  
  .container {
    padding: 0 12px;
  }
  
  .welcome-banner,
  .announcements-section {
    padding: 12px;
    min-height: 100px;
  }
  
  .banner-description {
  }

  .disclaimer-text {
  }
  
  .map-password-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .map-card-content {
    padding: 6px;
  }
  
  .stats-card-content {
    padding: 4px 6px;
  }
}

/* 性能优化 - 减少重绘 */
* {
  box-sizing: border-box;
}

/* 防止布局抖动 */
.map-password-grid,
.stats-overview {
  contain: layout;
}

/* 优化动画性能 */
.welcome-banner,
.announcements-section,
.map-password-naive-card {
  will-change: transform;
}

/* 字体优化 */
.map-password-value {
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

.stats-value {
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}
